package com.godyao.service.dynamic;


import com.godyao.framework.beans.factory.BeanFactory;
import com.godyao.framework.beans.factory.BeanFactoryAware;
import com.godyao.framework.stereotype.Service;

import java.util.Random;

public class UserService implements IUserService, BeanFactoryAware {
    public String queryUserInfo() {
        try {
            Thread.sleep(new Random(1).nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "小傅哥，100001，深圳";
    }

    public void register(String userName) {
        try {
            Thread.sleep(new Random(1).nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("注册用户：" + userName + " success！");
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) {
        System.out.println("bean工厂：" + beanFactory);
    }
}
